package com.tourism.home.dao;

import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ReportDao {

    //新增一条举报用户信息
    @Insert("insert into tb_report(content,ouid,uid) values(#{content},#{ouid},#{uid})")
    Integer addReportU(@Param("content") String content, @Param("ouid") Integer ouid, @Param("uid") Integer uid);

    //新增一条举报帖子信息
    @Insert("insert into tb_report(content,pid,uid) values(#{content},#{pid},#{uid})")
    Integer addReportP(@Param("content") String content, @Param("pid") Integer pid, @Param("uid") Integer uid);

    //某条帖子的所有举报用户的id
    @Select("select uid from tb_report where pid=#{pid}")
    List<Integer> getReportPostUIDs(@Param("pid") Integer pid);
    //某个用户的所有举报用户的id
    @Select("select uid from tb_report where ouid=#{ouid}")
    List<Integer> getReportUserUIDs(@Param("ouid") Integer ouid);

}
